<%@page import="java.util.GregorianCalendar"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.sql.*" %>
<%@include file="connection.jsp" %>
<%
    st=con.createStatement();
    rs =st.executeQuery("select sub_dt from user"); 
    
    Date last = rs.getDate(1);
    Calendar c = new GregorianCalendar();    
    c.setTime(last);
    c.add(Calendar.MONTH, 6);
    long newtime = c.getTime().getTime();
    Date newdate = new Date(newtime);
    
    String srno=(String)request.getParameter("newpack");
    String uid=(String)request.getParameter("uid");
    
    String sql="update user set pac_id='"+srno+"' where sr_no='"+uid+"'";
//    String sql1="update user set sub_dt='"+newdate+"' where sr_no='"+uid+"'";
    
    int i=st.executeUpdate(sql);
    out.print(i);
//    int i1=st.executeUpdate(sql1);
//    response.sendRedirect("portfolio.jsp");
%>